/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.spreedairy.portal.service.persistence;

import com.liferay.portal.service.persistence.BasePersistence;

import com.spreedairy.portal.model.CustomFieldValue;

/**
 * The persistence interface for the custom field value service.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author SpreeDairy
 * @see CustomFieldValuePersistenceImpl
 * @see CustomFieldValueUtil
 * @generated
 */
public interface CustomFieldValuePersistence extends BasePersistence<CustomFieldValue> {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this interface directly. Always use {@link CustomFieldValueUtil} to access the custom field value persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
	 */

	/**
	* Caches the custom field value in the entity cache if it is enabled.
	*
	* @param customFieldValue the custom field value
	*/
	public void cacheResult(
		com.spreedairy.portal.model.CustomFieldValue customFieldValue);

	/**
	* Caches the custom field values in the entity cache if it is enabled.
	*
	* @param customFieldValues the custom field values
	*/
	public void cacheResult(
		java.util.List<com.spreedairy.portal.model.CustomFieldValue> customFieldValues);

	/**
	* Creates a new custom field value with the primary key. Does not add the custom field value to the database.
	*
	* @param recId the primary key for the new custom field value
	* @return the new custom field value
	*/
	public com.spreedairy.portal.model.CustomFieldValue create(long recId);

	/**
	* Removes the custom field value with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param recId the primary key of the custom field value
	* @return the custom field value that was removed
	* @throws com.spreedairy.portal.NoSuchCustomFieldValueException if a custom field value with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomFieldValue remove(long recId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldValueException;

	public com.spreedairy.portal.model.CustomFieldValue updateImpl(
		com.spreedairy.portal.model.CustomFieldValue customFieldValue,
		boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the custom field value with the primary key or throws a {@link com.spreedairy.portal.NoSuchCustomFieldValueException} if it could not be found.
	*
	* @param recId the primary key of the custom field value
	* @return the custom field value
	* @throws com.spreedairy.portal.NoSuchCustomFieldValueException if a custom field value with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomFieldValue findByPrimaryKey(
		long recId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldValueException;

	/**
	* Returns the custom field value with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param recId the primary key of the custom field value
	* @return the custom field value, or <code>null</code> if a custom field value with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomFieldValue fetchByPrimaryKey(
		long recId) throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the custom field values where itemId = &#63;.
	*
	* @param itemId the item ID
	* @return the matching custom field values
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.CustomFieldValue> findByItemId(
		long itemId) throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the custom field values where itemId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param itemId the item ID
	* @param start the lower bound of the range of custom field values
	* @param end the upper bound of the range of custom field values (not inclusive)
	* @return the range of matching custom field values
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.CustomFieldValue> findByItemId(
		long itemId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the custom field values where itemId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param itemId the item ID
	* @param start the lower bound of the range of custom field values
	* @param end the upper bound of the range of custom field values (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching custom field values
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.CustomFieldValue> findByItemId(
		long itemId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the first custom field value in the ordered set where itemId = &#63;.
	*
	* @param itemId the item ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching custom field value
	* @throws com.spreedairy.portal.NoSuchCustomFieldValueException if a matching custom field value could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomFieldValue findByItemId_First(
		long itemId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldValueException;

	/**
	* Returns the first custom field value in the ordered set where itemId = &#63;.
	*
	* @param itemId the item ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching custom field value, or <code>null</code> if a matching custom field value could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomFieldValue fetchByItemId_First(
		long itemId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the last custom field value in the ordered set where itemId = &#63;.
	*
	* @param itemId the item ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching custom field value
	* @throws com.spreedairy.portal.NoSuchCustomFieldValueException if a matching custom field value could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomFieldValue findByItemId_Last(
		long itemId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldValueException;

	/**
	* Returns the last custom field value in the ordered set where itemId = &#63;.
	*
	* @param itemId the item ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching custom field value, or <code>null</code> if a matching custom field value could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomFieldValue fetchByItemId_Last(
		long itemId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the custom field values before and after the current custom field value in the ordered set where itemId = &#63;.
	*
	* @param recId the primary key of the current custom field value
	* @param itemId the item ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next custom field value
	* @throws com.spreedairy.portal.NoSuchCustomFieldValueException if a custom field value with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomFieldValue[] findByItemId_PrevAndNext(
		long recId, long itemId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldValueException;

	/**
	* Returns the custom field value where itemId = &#63; and keyName = &#63; or throws a {@link com.spreedairy.portal.NoSuchCustomFieldValueException} if it could not be found.
	*
	* @param itemId the item ID
	* @param keyName the key name
	* @return the matching custom field value
	* @throws com.spreedairy.portal.NoSuchCustomFieldValueException if a matching custom field value could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomFieldValue findByItemIdKeyvalue(
		long itemId, java.lang.String keyName)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldValueException;

	/**
	* Returns the custom field value where itemId = &#63; and keyName = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param itemId the item ID
	* @param keyName the key name
	* @return the matching custom field value, or <code>null</code> if a matching custom field value could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomFieldValue fetchByItemIdKeyvalue(
		long itemId, java.lang.String keyName)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the custom field value where itemId = &#63; and keyName = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param itemId the item ID
	* @param keyName the key name
	* @param retrieveFromCache whether to use the finder cache
	* @return the matching custom field value, or <code>null</code> if a matching custom field value could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomFieldValue fetchByItemIdKeyvalue(
		long itemId, java.lang.String keyName, boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the custom field values.
	*
	* @return the custom field values
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.CustomFieldValue> findAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the custom field values.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of custom field values
	* @param end the upper bound of the range of custom field values (not inclusive)
	* @return the range of custom field values
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.CustomFieldValue> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the custom field values.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of custom field values
	* @param end the upper bound of the range of custom field values (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of custom field values
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.spreedairy.portal.model.CustomFieldValue> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the custom field values where itemId = &#63; from the database.
	*
	* @param itemId the item ID
	* @throws SystemException if a system exception occurred
	*/
	public void removeByItemId(long itemId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes the custom field value where itemId = &#63; and keyName = &#63; from the database.
	*
	* @param itemId the item ID
	* @param keyName the key name
	* @return the custom field value that was removed
	* @throws SystemException if a system exception occurred
	*/
	public com.spreedairy.portal.model.CustomFieldValue removeByItemIdKeyvalue(
		long itemId, java.lang.String keyName)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.spreedairy.portal.NoSuchCustomFieldValueException;

	/**
	* Removes all the custom field values from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of custom field values where itemId = &#63;.
	*
	* @param itemId the item ID
	* @return the number of matching custom field values
	* @throws SystemException if a system exception occurred
	*/
	public int countByItemId(long itemId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of custom field values where itemId = &#63; and keyName = &#63;.
	*
	* @param itemId the item ID
	* @param keyName the key name
	* @return the number of matching custom field values
	* @throws SystemException if a system exception occurred
	*/
	public int countByItemIdKeyvalue(long itemId, java.lang.String keyName)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of custom field values.
	*
	* @return the number of custom field values
	* @throws SystemException if a system exception occurred
	*/
	public int countAll()
		throws com.liferay.portal.kernel.exception.SystemException;
}